var QQMapWX = require('@/utils/qqmap-wx-jssdk.min');
var qqmapsdk = new QQMapWX({
  key: '',
});

export const reverseGeocoder = (latitude, longitude) => {
  return new Promise((resolve, reject) => {
    qqmapsdk.reverseGeocoder({
      location: {
        latitude,
        longitude,
      },
      success: result => {
        const {
          adcode,
          province,
          city,
          district
        } = result.result.ad_info;
        resolve(result.result)
      },
      fail: () => {
        reject()
      }
    })
  })

}